// 1. 导入封装好的网络请求文件
import request from '../utils/request';

// 2. 定义你的后端接口
const api = {
  register: (params) => request.post('/api/register/', params),
  login: (params) => request.post('/api/token', params),
  getConversations:(params) => request.getWithParam("/api/conversations/",params),
  getMessages:(params) => request.getWithParam("/api/conversation/{conv_id}",params),
  updateConversation:(params) => request.put("/api/conversation/{conv_id}",params),
  deleteConversation:(params) =>request.deleteMethod("/api/conversation/{conv_id}",params),
  creatConversation:(params) =>request.post("/api/conversation/",params),
  createMessage:(params) =>request.post("/api/message/",params),
  chat: (params) => request.post('/api/chat', params),
  uploadFile:(params)=> request.upload('/api/local_doc_qa/upload_file', params),
  uploadFiles:(params)=> request.upload('/api/local_doc_qa/upload_files', params),
  localDocChat:(params)=> request.post('/api/local_doc_qa/local_doc_chat', params),
  getKbsList:(params)=>request.get('/api/local_doc_qa/list_knowledge_base',params),
  getDocsList:(params)=>request.get('/api/local_doc_qa/list_files',params),
  delKbs:(params) => request.deleteMethod("/api/local_doc_qa/delete_knowledge_base",params),
  delFilesInKb:(params) =>request.deleteMethod("/api/local_doc_qa/delete_file",params), 
  updateDoc:(params)=>request.post('/api/local_doc_qa/update_file',params)
  // 其他接口...
};
 
// 3. 导出接口对象
export default api;